package com.qiangesoft.rocketmq.consumer;

import com.qiangesoft.rocketmq.mode.MqConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 消费者
 *
 * @author qiangesoft
 * @date 2024-08-22
 */
@Slf4j
@Component
@RocketMQMessageListener(topic = MqConstant.HEAP_TOPIC, consumerGroup = "dj-consumer-group")
public class HeapConsumerListener implements RocketMQListener<MessageExt> {

    @Override
    public void onMessage(MessageExt message) {
        log.info(new String(message.getBody()));
    }

}
